<div>

<div class="panel panel-default mt10">
<div class="panel-body">
<div class="col-sm-12">

    <div class="row ">

        <div class="col-sm-2">
            <input type="text" class="form-control"  ng-model="searchform.name" placeholder="产品名称"> 
        </div>
        <div class="col-sm-2">
            <input type="text" class="form-control" ng-model="searchform.code" 
            placeholder="产品编号">
        </div>

        <div class="col-sm-2 col-sm-offset-6">
            <button class="btn btn-block btn-info"
            ng-click="load()"
            >搜索</button> 
        </div>

    </div>

</div>
</div>
</div>



<div class="panel panel-info " ng-repeat="obj in objs">
<div class="panel-heading" >
<div class="container-fluid">
<div class="row">
	<div class="col-sm-7" >
		<div 
		style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;width: 100;">
		[ {{obj.code}} ] <span class="h4 " style="color: #31708f;">{{obj.name}}</span>
		</div>
	</div>

	<div class="col-sm-4 text-right">
		{{obj.product_attr_label}} / {{obj.price_type_label}} / {{obj.back_type_label}} / {{obj.product_typename}} 
	</div>

	<div class="col-sm-1 text-right" style="cursor: pointer;" >
		<span ng-show="!obj.open" ng-click="open(obj)"> [展开] </span>
		<span ng-show="obj.open" ng-click="open(obj)"> [收回] </span>
	</div>
</div>
</div>
</div>

    <div class="panel-body">
<div class="row" ng-show="obj.open" >
	<div class="col-sm-2">
		<img ng-src="{{obj.toppic}}" class="img-thumbnail" width="100%" height="100%">
	</div>
	<div class="col-sm-10">
        <div >
            <div style="cursor: pointer;"
            ng-if="obj.opt.type == '0'"
            ng-click="changeOpt(obj,'type')"
            >
            <strong>分类设置：</strong>{{obj.type_label}} &nbsp; | &nbsp; 
            <strong>栏目设置：</strong>{{obj.column_label}}
            </div>

            <div 
            ng-if="obj.opt.type == '1'"
            >

            <form class="form-inline">
                <div class="form-group">
                    <label for="exampleInputName2">分类设置：</label>
                    <div class="input-group " >
                      <ui-select ng-model="obj.type_code" theme="bootstrap"  >
                        <ui-select-match placeholder=" -- 选择分类 -- ">
                            {{$select.selected.type_name}}
                        </ui-select-match>
                        <ui-select-choices repeat="item.type_code as item in label.typelist | filter: $select.search">
                            <span ng-bind-html="item.type_name | highlight: $select.search"></span>
                        </ui-select-choices>
                      </ui-select>
                      <span class="input-group-btn">
                        <button class="btn btn-default" type="button"
                        ng-click="setType(obj)"
                        >OK</button>
                      </span>
                    </div>
                </div>

                &nbsp;&nbsp;&nbsp;&nbsp;

                <div class="form-group">
                    <label for="exampleInputName2">栏目设置：</label>
                    <div class="input-group" >
                      <ui-select ng-model="obj.column_code" theme="bootstrap"  >
                        <ui-select-match placeholder=" -- 选择栏目 -- ">
                            {{$select.selected.column_name}}
                        </ui-select-match>
                        <ui-select-choices repeat="item.column_code as item in label.columnlist | filter: $select.search">
                            <span ng-bind-html="item.column_name | highlight: $select.search"></span>
                        </ui-select-choices>
                      </ui-select>
                      <span class="input-group-btn">
                        <button class="btn btn-default" type="button"
                        ng-click="setColumn(obj)"
                        >OK</button>
                      </span>
                    </div>
                </div>
              
            </form>
            </div>
            
        </div>

		<div class="table-responsive mt10">
	        <table class="table table-condensed table-hover table-bordered">
	            <thead>
	                <tr>
	                    <th class="col-md-4 text-center">型号名</th>
	                    <th class="col-md-2 text-center">成本价格</th>
	                    <th class="col-md-2 text-center">商城价格</th>
	                    <th class="col-md-4 text-center">操作</th>
	                </tr>
	            </thead>
	            <tbody>
	             	<tr ng-repeat="attr in obj.attrlist" ng-if="attr.state == '1'">
	             		<td>
	             			{{attr.attr_name}}
	             		</td>
	             		<td class="text-center">
	             			{{attr.cost_price}}
	             		</td>
	             		<td class="text-center">
	             			{{attr.guide_price}}
	             		</td>
	             		<td>
	             			
	             		</td>
	             	</tr>
	            </tbody>

	        </table>
	    </div>
	</div>
</div>


<div class="row">
	<div class="col-sm-6">
		<div class="pt5" ng-if="obj.state == '2'">
            <div 
            ng-if="obj.unavailableReasons == ''"
            class="green">可以上架</div>
            <div 
            ng-if="obj.unavailableReasons != ''"
            class="red"><strong>不能上架原因：</strong>{{obj.unavailableReasons}}</div>
        </div>
	</div>
	<div class="col-sm-6 text-right">

		<button type="button" class="btn btn-success btn-xs"
        ng-if="obj.myproduct != '1'"
        ng-click="edit(obj)"
        >
            <span class="glyphicon glyphicon-edit" aria-hidden="true"></span> 编辑
        </button>

        <button type="button" class="btn btn-primary btn-xs"
        ng-if="obj.state == '1' && obj.myproduct != '1'"
        ng-click="release(obj)"
        >
            <span class="glyphicon glyphicon-tower" aria-hidden="true"></span> 发布到群盟
        </button>
        
        <!-- <button type="button" class="btn btn-info btn-xs"
        ng-if="obj.myproduct != '1'"
        ng-click="setPoster(obj)"
        >
            <span class="glyphicon glyphicon-gift" aria-hidden="true"></span> 海报
        </button> -->
        <button type="button" class="btn btn-warning btn-xs"
        ng-click="commission(obj)"
        >
            <span class="glyphicon glyphicon-usd" aria-hidden="true"></span> 佣金
        </button>
        <button type="button" class="btn btn-success btn-xs"
        ng-if="obj.state == '2'"
        ng-click="up(obj)"
        ng-disabled="obj.unavailableReasons != ''" 
        >
            <span class="glyphicon glyphicon-open" aria-hidden="true"></span> 上架
        </button>

        <button type="button" class="btn btn-success btn-xs"
        ng-if="obj.state == '1'"
        ng-click="down(obj)"
        >
            <span class="glyphicon glyphicon-save" aria-hidden="true"></span> 下架
        </button>

        
        <button type="button" class="btn btn-danger btn-xs"
        ng-if="obj.state == '2'"
        ng-click="delete(obj)"
        >
            <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> 删除
        </button>
	</div>
</div>

    </div>

    

</div>


<div class="text-right mt10">
     <pagination total-items="bigTotalItems" ng-model="bigCurrentPage" ng-change="load()" previous-text="上一页" next-text="下一页"
        first-text="首页" last-text="尾页" max-size="maxSize" boundary-links="true" rotate="false" items-per-page="itemsPerPage"
        class="m-t-none m-b">
    </pagination>
</div> 





</div>